<?php


	class Validation{
		
		public function ValidateUserName($userName){
								
			if ($userName == null){
				return false;
			}
			return true;
		}
		
		public function ValidateUserNameChar($userName){
				
			$trimusername = trim($userName);
			$pattern = "/^[_a-zA-Z0-9]{5,15}$/";
			if(!preg_match($pattern, $trimusername))
			{
				return false;
			}			
			return true;
		}
		
		public function ValidatePassword($password){
				
			if (strlen($password) < 6){
				return false;					
			}
			return true;			
		}
		
		public function ValidatePasswordChar($password){
		
			$trimPassword = trim($password);
			$pattern = "/^[_a-zA-Z0-9]{6,15}$/";
			if (!preg_match($pattern, $trimPassword))
			{
				return false;
			}	
			return true;
		}
		
		public function ComparePassword($password, $password2){
				
			if ($password != $password2){
				return false;									
			}
			return true;
		}	
		
	}
